﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynCMS.NET.Core.Entities.Configuration
{
    /// <summary>
    /// Group of configuration settings for cms
    /// </summary>
    public class Set : Base.PersistableEntity
    {
        public const string DefaultSetName = "Default";

        public static Set CreateDefaultSettings()
        {
            Set result = new Set()
            {
                Name = DefaultSetName,
                Settings = new List<Setting>()
            };

            result.Settings.Add(new Setting()
            {
                Set = result,
                SettingName = Setting.SettingNames.CaseSensitive,
                Value = false.ToString(),
                Type = Setting.SettingValueType.Boolean
            });
            return result;
        }

        /// <summary>
        /// Configuration set name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// List of settings in configuraton set
        /// </summary>
        public virtual List<Setting> Settings { get; set; }
    }
}